
import { Code, Entity, PrimaryUuid, Title, Cover, Desc, Digdit, GymCourseType, GymPlaceId, GymTeacherId, Jsonb, CreateDate, Boolean, Uuid } from '@sker/core'
/**
 * why
 */
@Entity({
    name: 'gym_course2',
})
export class GymCourse2 {
    static title: string = `课程`;
    static resource: string = `gym_course2`;

    @PrimaryUuid({
        primaryKeyConstraintName: "PK_GYM_COURSE2_ID"
    })
    id!: string;

    @Title({ label: '课程名称', comment: '课程名称' })
    title!: string;

    @Uuid({ label: "课程分类", comment: '课程分类' })
    category_id!: string;

    @Code({
        label: '课程标签',
        comment: '课程标签',
    })
    tag!: string

    @GymPlaceId({ label: '授课场馆' })
    place_id: string;

    @GymTeacherId({ label: '选择教练', nullable: true })
    teacher_id: string;

    @Cover({ label: '课程封面', comment: '课程封面' })
    cover!: string;

    @Desc({ label: '课程简介', comment: '课程简介', hideInTable: true })
    desc!: string;

    @Digdit()
    min: number;

    @Digdit()
    max: number;

    @Boolean({ label: '设置日期' })
    is_set_date: boolean;

    @Jsonb({
        label: '课程周期时间',
        valueType: 'dateRange'
    })
    time_range: any;

    @Code({
        label: '排课周期',
        valueType: 'checkbox',
        valueEnum: {
            1: '周一',
            2: '周二',
            3: '周三',
            4: '周四',
            5: '周五',
            6: '周六',
            7: '周日'
        }
    })
    week: string;

    @Jsonb({
        label: '课程时段',
        valueType: 'checkbox',
        valueEnum: {
            1: '8:00-10:00',
            2: '10:00-12:00',
            3: '8:00-10:00',
            4: '8:00-10:00',
            5: '8:00-10:00'
        }
    })
    time: string[];


    @GymCourseType({ comment: '消耗课时卡类型', nullable: true, hideInTable: true, hide: true, })
    card_type: string;

    @Digdit({ default: 1 })
    card_time: number;

    @Boolean({ label: '是否赠送自训' })
    is_give_place: boolean;

    @Digdit({ comment: '赠送自训次数', tooltip: '0表示不赠送', nullable: true, hideInTable: true })
    place_time: number;

    @CreateDate()
    create_date: Date;

}